# @Time : 2025/4/19 1:00
# @Author : ZhangQi
from typing import Dict


def adb_function(schema: Dict):
    """阿里云兼容的函数注册装饰器"""

    def decorator(func):
        func._function_schema = {
            "type": "function",
            "function": {
                "name": schema["name"],
                "description": schema["description"],
                "parameters": schema.get("parameters", {})
            }
        }
        return func

    return decorator
